package redisinit

import (
	"2298a/meituan/api/appconfig"
	"fmt"
	"github.com/go-redis/redis/v8"
)

var (
	RedisClient *redis.Client
	err         error
)

func Redis() {
	redisConf := appconfig.AppConf.RedisConfig
	RedisClient = redis.NewClient(&redis.Options{
		Addr:     redisConf.Addr,
		Password: redisConf.Password, // no password set
		DB:       redisConf.Db,       // use default DB
	})
	if err != nil {
		fmt.Println("redis连接信息失败", err)
		return
	}
	fmt.Println("redis连接信息成功")
}
